<?php

	header("Content-Type: text/html;charset=utf-8"); 

	include("../function/_nosql.php");

	include("../function/function.php");
	include("../_include.user.judge2.php");
	$URL = $_SERVER['REQUEST_URI'];
	$newsid = chkstr(trim($_REQUEST['newsid']));
	if(is_numeric($newsid)){



		$sql="select * from kboy_forum_active where id=$newsid";



		$rows=mysql_query($sql);



		$nums=mysql_num_rows($rows);



		if($nums>0){



			$rs=mysql_fetch_array($rows);
				$aid = $rs['id'];
				
				$active_title = $rs['active_title'];          //
				 


				$active_bigclass = $rs['active_bigclass'];

				$active_renzheng = $rs['active_renzheng'];

				$active_mingyi = $rs['active_mingyi'];



				$active_fanwei = $rs['active_fanwei'];



				$active_xianzhi = $rs['active_xianzhi'];



				$active_all_money = $rs['active_all_money'];//
				
				$active_cva_money = $rs['active_cva_money'];
				
				$active_part_money = $rs['active_part_money'];//
				$active_tian = $rs['active_tian'];
				
				$active_end_user = $rs['active_end_user'];



				$active_text = $rs['active_text'];//


				$active_pic = explode(',', $rs['active_pic']);		//

				
				if(!empty($rs['active_sollimg'])){
					$active_sollimg = explode(',', $rs['active_sollimg']);
				}
				$active_hd_content = $rs['active_hd_content'];
				$active_all_line = $rs['active_all_line'];

				$active_start_prov = $rs['active_start_prov'];



				$active_start_city = $rs['active_start_city'];



				$active_end_prov = $rs['active_end_prov'];



				$active_end_city = $rs['active_end_city'];



				$active_start_time = $rs['active_start_time'];



				$active_end_time = $rs['active_end_time'];



				$active_power = $rs['active_power'];



				$active_post_time = $rs['active_post_time'];



				$active_center = $rs['active_center'];



				$active_center_time = $rs['active_center_time'];



				$active_jingdian = $rs['active_jingdian'];



				$active_traffic = $rs['active_traffic'];



				$active_traffic_info = $rs['active_traffic_info'];

				$active_state = $rs['active_state'];

				$active_contact = $rs['active_contact'];



				$active_contact_people = $rs['active_contact_people'];



				$active_contact_phone = $rs['active_contact_phone'];



				$active_people = $rs['active_people'];



				$active_line = stripslashes($rs['active_line']);



				$active_xingcheng = stripslashes($rs['active_xingcheng']);



				$active_zhuangbei = stripslashes($rs['active_zhuangbei']);



				$active_baoming = stripslashes($rs['active_baoming']);



				$active_ditu = stripslashes($rs['active_ditu']);



				$active_koubei = stripslashes($rs['active_koubei']);



				$active_addtime = $rs['active_addtime'];



				$uid = $rs['uid'];



				$active_id = $rs['id'];



				$active_transport=$rs['active_transport'];



				$active_charge_details=$rs['active_charge_details'];



				$active_favor = $rs['active_favor'];

				$active_object=$rs['active_object'];



				



				$news_content = stripslashes($rs['travel_content']);



				$news_hit = $rs['travel_hit'];



				$uid = $rs['uid'];



				$active_hits = $rs['active_hits']+1;



				$sql_up = " update kboy_forum_active set `active_hits`=$active_hits where id =$active_id";



				mysql_query($sql_up);


				



				



		}else{



			echo erro("该信息已被删除或不存在");



		}



	}else{



		echo erro("该信息已被删除或不存在");



	}
	function str_count($sql,$str){

 $res = mysql_query($sql);

 $num = mysql_num_rows($res);

 $count = 0;

  if($num>0){

	while($arr=mysql_fetch_array($res)){

	 $count = $count + $arr[$str];

	}

  }

  return $count;

} 
	
?>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title><?= $active_title.'_'.$web_titles ?></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="Keywords" content="<?= $web_keywords ?>" />
		<meta name="Description" content="<?= $web_description ?>" />
		<link rel="stylesheet" href="css/bootstrap.min.css">
		<link rel="stylesheet" type="text/css" href="css/index.css"/>
		<link rel="stylesheet" type="text/css" href="./css/xiangqing.css"/>
		<script type="text/javascript" src="../js/baidutongji.js"></script>
		<script src="js/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="wrap">
			<div class="head">
				<img src="../<?php 
												if($active_pic){
													echo $active_pic[0];
												}else{
													echo $active_pic;
												}
                                        	?>" alt="" />
			</div>
			
						<div class="title">
							<?=$active_title?>
							<p>￥<?=$active_all_money?> <span>起</span></p>
							<div class="xiang lingdui">
								<p>领队<span>：<?php echo $active_end_user;?></span></p>
								<p>电话<span>：<?php echo $active_contact?></span></p>
								<p>应急<span>：<?php echo $active_contact_phone;?></span></p>
							</div>
						</div>
						<ul class="ziliao">
							<li>
								<h3>活动特色</h3>
								<p><?=$active_text?></p>
							</li>
							<li>
								<h3>详情:</h3>
								<div class="xiang">
									<p><span>出发时间</span><?=$active_start_time?></p>
									<p><span>结束时间</span><?=$active_end_time?></p>
									<p><span>集合时间</span><?=$active_center_time?></p>
									<p><span>集合地点</span><?=$active_center?></p>
									<p><span>目的地</span><?php echo $active_end_prov.','.$active_end_city;?></p>
									<p><span>活动内容</span><?=$active_hd_content?></p>
									<p><span>活动景点</span><?=$active_jingdian?></p>
									<p><span>强度等级</span><?=getClassName("kboy_bigclass","bigclass_cn","id=".$active_power);?></p>
									<p><span>交通方式</span><?php if($active_traffic=='不包车'){ echo $active_transport; }else{ echo $active_traffic;} ?></p>
								</div>
							</li>
						</ul>
			<!--<div class="dianping">-->
			<!--	<h3>驴友点评：</h3>-->
			<!--	<ul>-->
			<!--		<li class="dianping-li">-->
			<!--			<p class="dianping-p">(<span>96%</span>满意度)</p>-->
			<!--			<p class="dianping-p  pinglun">共<span>300</span>个点评</p>-->
			<!--		</li>-->
			<!--		<li class="dianping-li">-->
			<!--			<div class="dianping-name">-->
			<!--				<img src="image/top_pic2.png"/>-->
			<!--				<p class="dianping-p">dsdswe</p>-->
			<!--				<p class="dianping-p pinglun">2015-10-14</p>-->
			<!--			</div>-->
			<!--		</li>-->
			<!--		<li class="dianping-li">-->
			<!--			<p class="dianping-p">-->
			<!--				导游服务： 导游人很负责任，讲解详细，服务周到。-->
			<!--				行程安排： 行程安排合理 玩得很轻松-->
			<!--				父母很满意，期待再次体验!-->
			<!--			</p>-->
			<!--		</li>-->
			<!--		<li class="dianping-li ping-mero">-->
			<!--			<a href="javascript:;">查看全部评论</a>-->
			<!--		</li>-->
			<!--	</ul>-->
			<!--</div>			-->
		<div class="gengduo">
			<div class="xiany">
				<a href="javascript:;">行程安排&nbsp; <span>更多></span></a>
				<div class="xing gaibian">
					<?php echo $active_xingcheng;?>
				</div>
			</div>
			
			<div class="xiany">
				<a href="javascript:;">费用说明&nbsp; <span>更多></span></a>
				<div class="xing gaibian">
					<?php echo $active_charge_details;?>
				</div>
			</div>
			<div class="xiany">
				<a href="javascript:;">装备要求&nbsp; <span>更多></span></a>
				<div class="xing gaibian">
					<?php echo $active_zhuangbei;?>
				</div>
			</div>
			<div class="xiany gaibian">
				<a href="javascript:;">线路描述&nbsp; <span>更多></span></a>
				<div class="xing">
					<?php echo $active_line;?>
				</div>
			</div>
			<div class="xiany gaibian">
				<input type="hidden" name="newsid" value="<?php echo $newsid;?>" />
				<a href="javascript:;">报名须知&nbsp; <span>更多></span></a>
				<div class="xing">
					<?php echo $active_baoming;?>
				</div>
			</div>
			<div class="xiany gaibian">
				<a href="hdadds.php?aid=<?php echo $aid;?>">增加外挂人员 <i class="iconfont-i">&#xe620;</i></a>
			</div>
			<div class="xiany">
				<a href="javascript:;">报名列表（已参加<?php $newss = str_count("select * from  kboy_order where order_tuiactive_content = '' and order_tui_content = '' and aid=$newsid group by uid","order_num"); echo $newss; ?>人）</a>
				<div class="xing">
					<div class="bd">
                                            <div class="ulWrap">
												<?php
												    $i=0;
													$order_sql = "select * from kboy_user  where uid in ( select `uid` from kboy_order where order_states = 0 and aid=".$newsid."  group by uid order by id desc )  order by uid desc  ";
													$order_rows = mysql_query($order_sql);
													$order_nums = mysql_num_rows($order_rows); 
													while($order_rs = mysql_fetch_array($order_rows)){
													 if($i%8==0){ echo "<ul>";}
													 $sexnum = getClassName("kboy_user","user_sex","uid=".$order_rs['uid']);
													 if($sexnum==0){$sex='女';}else if($sexnum==1){ $sex= "男";}else{ $sex='保密';} 
													?>
													<li>
                                                        <div class="sign-item">
                                                            <div class="pic"><a href="../forum_active.php?uid=<?=$order_rs['uid']?>"><img src="<?=$order_rs['user_face'];?>" width="68" height="68" alt=""/></a></div>
                                                        </div>
                                                        <div class="sign-info">
                                                            <p class="name"><a href="../forum_active.php?uid=<?=$order_rs['uid']?>"><?=$order_rs['user_nickname'];?></a></p>
                                                            <p>性别:<?=$sex;?></p>
                                                            <p>人数:<?=getClassName("kboy_order","order_num","uid=".$order_rs['uid']." and aid=".$newsid);?></p>
                                                        </div>
                                                    </li>
													<?php
													 if($i%8==7 || ($i%8!=7 && ($i==($order_nums-1)) ) ){ echo "</ul>";}
													$i++;
													}
													?>
                                            </div>
                                        </div>
				</div>
			</div>
		</div>
		    <div class="foot">返回<a href="index.php">徒步网</a> 2002-2016 chinawalking</div>
		</div>
		<div class="shengming shengliji"> 
			<div class="quxiao">X</div>     
				<h4>免责声明：</h4>  
				<p class="shengming-txt"> 
				  	户外活动存在危险与不确定性！参加活动人员必须身体健康，有民事自主能力的公民，并已知晓自己所参与的活动存在不确定性和危险性以及完全理解户外ＡＡ制（费用自理/责任自负/风险自担）活动之概念。请参与队员自行认定活动的轻重性，并对出发至返回过程中所有不可预见的意外及风险具备足够的心理及生理承受能力，参加此次活动纯属个人自愿行为，如发生意外与其他同行者无关。建议参加人员购买相关保险。<br />
				  	责任声明： 本活动为非盈利性质的自助结伴游活动并具有一定的危险性，参加者必须对自己的安全负责，活动中发生意外事故，同行者可根据实际情况组织救援或改变活动计划，但不承担任何法律和经济责任，特此声明。活动开始后，本声明将自动生效并表明你接受本声明，否则，请在活动开始前退出本次活动。<br />
					免责条款： 此户外活动属于自助性质的出行活动，当由于意外事故和急性疾病等不可预测因素造成身体损伤时，其他成员尽力救助，但如果造成了不可逆转的永久损伤，其他成员不承担任何（精神和经济）责任。团队中的任何一个队员本着“在力所能及情况下尽力救助、风险自担”的原则参加救助活动。<br />
					关于交通工具的责任条款：户外活动所乘的交通工具，租车活动来回途中因交通事故造成乘员人身伤害和财产损失，按有关法律法规处理，发起人和同行人员不承担任何责任。<br />
					凡报名参加活动者均视为具有完全民事行为能力人，如在活动中发生人身损害及财产损失，发起人及参加活动人员不承担任何赔偿责任，凡报名者均视为接受以上条款声明。 代他人报名者，被代报名参加者如遭受人身损害及财产损失，发起人及同行人员不承担赔偿责任，报名并成行人员视同已经接受以上免责条款 。
				</p>
				<form class="tiaok" action="baoming.php?newsid=<?=$active_id?>" method="post">
					<label><input type="checkbox" name="ty" class="fuxi" value="1"> <span class="check-txt">我已阅读并同意免责声明条列！</span></label>
					<input  type="submit" name="" id="shengming-sub" value="同意" />
				</form> 
		</div> 
		<div class="shengming shengm "> 
			<div class="quxiao">X</div>     
				<h4>免责声明：</h4>  
				<p class="shengming-txt"> 
				  	户外活动存在危险与不确定性！参加活动人员必须身体健康，有民事自主能力的公民，并已知晓自己所参与的活动存在不确定性和危险性以及完全理解户外ＡＡ制（费用自理/责任自负/风险自担）活动之概念。请参与队员自行认定活动的轻重性，并对出发至返回过程中所有不可预见的意外及风险具备足够的心理及生理承受能力，参加此次活动纯属个人自愿行为，如发生意外与其他同行者无关。建议参加人员购买相关保险。<br />
				  	责任声明： 本活动为非盈利性质的自助结伴游活动并具有一定的危险性，参加者必须对自己的安全负责，活动中发生意外事故，同行者可根据实际情况组织救援或改变活动计划，但不承担任何法律和经济责任，特此声明。活动开始后，本声明将自动生效并表明你接受本声明，否则，请在活动开始前退出本次活动。<br />
					免责条款： 此户外活动属于自助性质的出行活动，当由于意外事故和急性疾病等不可预测因素造成身体损伤时，其他成员尽力救助，但如果造成了不可逆转的永久损伤，其他成员不承担任何（精神和经济）责任。团队中的任何一个队员本着“在力所能及情况下尽力救助、风险自担”的原则参加救助活动。<br />
					关于交通工具的责任条款：户外活动所乘的交通工具，租车活动来回途中因交通事故造成乘员人身伤害和财产损失，按有关法律法规处理，发起人和同行人员不承担任何责任。<br />
					凡报名参加活动者均视为具有完全民事行为能力人，如在活动中发生人身损害及财产损失，发起人及参加活动人员不承担任何赔偿责任，凡报名者均视为接受以上条款声明。 代他人报名者，被代报名参加者如遭受人身损害及财产损失，发起人及同行人员不承担赔偿责任，报名并成行人员视同已经接受以上免责条款 。
				</p>
				<form class="tiaok" action="javascript:;" method="post">
					<label class="dian_01"><input type="checkbox" name="ty" class="fuxi" value="1"> <span class="check-txt">我已阅读并同意免责声明条列！</span></label>
					<button class="yibu" id="shengming-sub" style="display: none;">同意</button>
					<button class="yibutow" id="shengming-sub" style="display: block;">同意</button>
				</form> 
		</div>
		<div class="huodong-bm">
			<?php if(!$_SESSION['kboy_userid']){ ?>
				<?php if(date('Y-m-d H:i:s') >= $active_post_time){ ?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">报名结束</a>	
				<?php }else if(date('Y-m-d H:i:s') >= $active_end_time) {?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">活动结束</a>	
				<?php }else if($active_state == 1){?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">活动已下线</a>	
				<?php }else if(getAllCount("kboy_order","order_num","order_state=1 and aid=$newsid group by uid") >= $active_people){ ?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">人员已满</a>		
				<?php }else{ ?>
				<!--<a href="baoming.php?newsid=<?=$active_id?>" class="baoming">立即报名</a>-->
				<a href="javascript:;" class="baoming lijib">立即报名</a>
				<?php } ?>
			<?php }else{ ?>
				<?php if(getNewsNums("kboy_order","aid=$active_id and order_states = 0 and uid = ".$_SESSION['kboy_userid']) >= 1 ){ ?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">已经报名</a>
				<?php }else if(date('Y-m-d H:i:s') >= $active_post_time){ ?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">报名结束</a>	
				<?php }else if(date('Y-m-d H:i:s') >= $active_end_time) {?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">活动结束</a>	
				<?php }else if($active_state == 1){?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">活动已下线</a>	
				<?php }else if(getAllCount("kboy_order","order_num","order_state=1 and aid=$newsid group by uid") >= $active_people){ ?>
				<a href="javascript:;" class="baoming" style="background: #AAACAF;">人员已满</a>		
				<?php }else{ ?>
				<a href="javascript:;" class="baoming woyaob">我要报名</a>
				<?php } ?>
			<?php } ?>
		</div>
		<div class="baom">
				<div class="quxiao">
					X
				</div>
		</div>
		
	</body>
	</html>
<script>
    $(document).ready(function() { 
        $(".gengduo .xiany a").click(function(){
        	var a = $(this).offset().top;
            $(this).addClass("on").closest(".xiany").siblings(".xiany").find(".xing").slideUp("xiany").siblings("a").removeClass("on");
            $(this).next(".xing").slideToggle("xiany");
            $('body,html').animate({'scrollTop':a},500)
        });
    });
</script>
<script type="text/javascript">
	$(function(){
		$(".huodong-bm .lijib").click(function(){
					$(".shengliji").show();
					$(this).hide();
		}); 
		$(".huodong-bm .woyaob").click(function(){
					$(".shengming").show();
					$(this).hide();
		}); 
		$(".quxiao").click(function(){
			$(".shengming").hide();
			$('.lijib').show();
		});
		$(".quxiao").click(function(){
			$(".shengming").hide();
			$('.woyaob').show();
		}); 
		$(".quxiao").click(function(){
			$(".baom").css({"display":"none"});
			$(".yibu").css({"display":"block"});
		})
		$(".dian_01").click(function(){
			$(".yibu").toggle().css({"background":"#4b8ee8","color":"#f3f2f5"});
			$(".yibutow").toggle().css({"background":"#f3f2f5","color":"#4b8ee8"});
		})
		$(".check-txt").click(function(){
			$(".yibu").toggle().css({"background":"#4b8ee8","color":"#f3f2f5"});
			$(".yibutow").toggle().css({"background":"#f3f2f5","color":"#4b8ee8"});
		})
		$(".yibutow").click(function(){
			alert("请点击“我已阅读……”，方可报名");
		});
	});
</script>
<script type="text/javascript">
	$(function(){
		$("input[name=shangche]").click(function(){
		var aid = $("input[name=newsid]").val();
		var from = $(".qing");
		$.ajax({
				type:"post",
				url:"ajax.php?aid=shang",
				data:{aid:aid},
				dataType:"json",
				success:function(data){
					
					if(data["zong"] > 1){
						$(".baom").css({"height":"240px"});
						var str = '<div class="qing"><p>请选择上车地</p><form><select name="shangched"><option value="">请选择？</option><option value="'+data["data"][0]+'">'+data["data"][0]+'</option><option value="'+data["data"][1]+'">'+data["data"][1]+'</option></select><br /><input type="button" class="duoshang" value="确定"/></form></div>';
					}else{
						if(data['money'] != 0){
							var str = '<div class="qing"><p>上车地：</p><div class="yige"><a href="javascript:;" class="scddian">'+data["data"]+'</a><a href="javascript:;">确定</a></div></div>';
						}else{
							var str = '<div class="qing"><p>集合地点为：</p><div class="yige"><a href="javascript:;" class="scddian">'+data["data"]+'</a><a href="javascript:;">确定</a></div></div>';
						}
					}
					$(".baom").css({"display":"block"});
					$(".yibu").css({"display":"none"});
					from.remove();
					$(".baom").append(str);
					$(".qing .yige").on('click',function(){
						var scddian = $(".scddian").html();
						$("input[name=shangche]").val(scddian);
						$(".baom").hide();
					})
					$(".duoshang").on('click',function(){
						var scddian = $("select[name=shangched]").val();
						$("input[name=shangche]").val(scddian);
						$(".baom").hide();
					})
				}
			});
		}) 
		$(".yibu").click(function(){
			var aid = $("input[name=newsid]").val();
			var from = $(".qing");
			
			$.ajax({
				type:"post",
				url:"../ajax.php?aid=shang",
				data:{aid:aid},
				dataType:"json",
				success:function(data){
					if(data["zong"] > 1){
						$(".baom").css({"height":"240px"});
						var str = '<div class="qing"><p>请选择上车地</p><form action="baoming_add.php?aid='+aid+'" method="post"><select name="shangche"><option value="">请选择？</option><option value="'+data["data"][0]+'">'+data["data"][0]+'</option><option value="'+data["data"][1]+'">'+data["data"][1]+'</option></select><br /><input type="submit" value="确定"/></form></div>';
					}else{
						if(data['money'] != 0){
							var str = '<div class="qing"><p>您的上车地：</p><div class="yige"><a href="baoming_add.php?aid='+aid+'">'+data["data"]+'</a><a href="baoming_add.php?aid='+aid+'">同意</a></div></div>';
						}else{
							var str = '<div class="qing"><p>集合地点为：</p><div class="yige"><a href="baoming_add.php?aid='+aid+'">'+data["data"]+'</a><a href="baoming_add.php?aid='+aid+'">同意</a></div></div>';
						}
					}
					$(".baom").css({"display":"block"});
					$(".yibu").css({"display":"none"});
					from.remove();
					$(".baom").append(str);
				}
			});
		});
		
	});
</script>









